3.1009 \(\int \frac {a b B-a^2 C+b^2 B \cos (c+d x)+b^2 C \cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx\)

Optimal. Leaf size=23 \[ x (b B-a C)+\frac {b C \sin (c+d x)}{d} \]

[Out]

(B*b-C*a)*x+b*C*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 48, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.042, Rules used = {24, 2637} \[ x (b B-a C)+\frac {b C \sin (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a*b*B - a^2*C + b^2*B*Cos[c + d*x] + b^2*C*Cos[c + d*x]^2)/(a + b*Cos[c + d*x]),x]

[Out]

(b*B - a*C)*x + (b*C*Sin[c + d*x])/d

Rule 24

Int[(u_.)*((a_) + (b_.)*(v_))^(m_)*((A_.) + (B_.)*(v_) + (C_.)*(v_)^2), x_Symbol] :> Dist[1/b^2, Int[u*(a + b*
v)^(m + 1)*Simp[b*B - a*C + b*C*v, x], x], x] /; FreeQ[{a, b, A, B, C}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0] &&
 LeQ[m, -1]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {a b B-a^2 C+b^2 B \cos (c+d x)+b^2 C \cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx &=\frac {\int \left (b^2 (b B-a C)+b^3 C \cos (c+d x)\right ) \, dx}{b^2}\\ &=(b B-a C) x+(b C) \int \cos (c+d x) \, dx\\ &=(b B-a C) x+\frac {b C \sin (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 34, normalized size = 1.48 \[ -a C x+b B x+\frac {b C \sin (c) \cos (d x)}{d}+\frac {b C \cos (c) \sin (d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a*b*B - a^2*C + b^2*B*Cos[c + d*x] + b^2*C*Cos[c + d*x]^2)/(a + b*Cos[c + d*x]),x]

[Out]

b*B*x - a*C*x + (b*C*Cos[d*x]*Sin[c])/d + (b*C*Cos[c]*Sin[d*x])/d

________________________________________________________________________________________

fricas [A]  time = 0.88, size = 27, normalized size = 1.17 \[ -\frac {{\left (C a - B b\right )} d x - C b \sin \left (d x + c\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a^2*C+b^2*B*cos(d*x+c)+b^2*C*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="fricas")

[Out]

-((C*a - B*b)*d*x - C*b*sin(d*x + c))/d

________________________________________________________________________________________

giac [A]  time = 0.17, size = 48, normalized size = 2.09 \[ -\frac {{\left (C a - B b\right )} {\left (d x + c\right )} - \frac {2 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a^2*C+b^2*B*cos(d*x+c)+b^2*C*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="giac")

[Out]

-((C*a - B*b)*(d*x + c) - 2*C*b*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1))/d

________________________________________________________________________________________

maple [A]  time = 0.12, size = 32, normalized size = 1.39 \[ \frac {C b \sin \left (d x +c \right )+B \left (d x +c \right ) b -a C \left (d x +c \right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*a*b-a^2*C+b^2*B*cos(d*x+c)+b^2*C*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x)

[Out]

1/d*(C*b*sin(d*x+c)+B*(d*x+c)*b-a*C*(d*x+c))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a^2*C+b^2*B*cos(d*x+c)+b^2*C*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?`
 for more details)Is 4*b^2-4*a^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 1.87, size = 25, normalized size = 1.09 \[ \frac {C\,b\,\sin \left (c+d\,x\right )+d\,x\,\left (B\,b-C\,a\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((C*b^2*cos(c + d*x)^2 - C*a^2 + B*a*b + B*b^2*cos(c + d*x))/(a + b*cos(c + d*x)),x)

[Out]

(C*b*sin(c + d*x) + d*x*(B*b - C*a))/d

________________________________________________________________________________________

sympy [A]  time = 0.69, size = 58, normalized size = 2.52 \[ \begin {cases} B b x - C a x + \frac {C b \sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\\frac {x \left (B a b + B b^{2} \cos {\relax (c )} - C a^{2} + C b^{2} \cos ^{2}{\relax (c )}\right )}{a + b \cos {\relax (c )}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a**2*C+b**2*B*cos(d*x+c)+b**2*C*cos(d*x+c)**2)/(a+b*cos(d*x+c)),x)

[Out]

Piecewise((B*b*x - C*a*x + C*b*sin(c + d*x)/d, Ne(d, 0)), (x*(B*a*b + B*b**2*cos(c) - C*a**2 + C*b**2*cos(c)**
2)/(a + b*cos(c)), True))

________________________________________________________________________________________